package com.itheima.dao.impl;

import com.itheima.dao.AccountDao;
import org.apache.commons.dbutils.QueryRunner;

import java.sql.SQLException;

public class AccountDaoImpl implements AccountDao {
    private QueryRunner queryRunner;
    @Override
    public void update() throws SQLException {
        //创建sql语句
        String sql = "update tal_account set username = ? ,money = ? where id = ?";

        //参数
        Object[] params = {"孙悟空",10000,2};
        //执行
        queryRunner.update(sql,params);
    }

    public void setQueryRunner(QueryRunner queryRunner) {
        this.queryRunner = queryRunner;
    }
}
